#ifndef CFG_CFG_H
#define CFG_CFG_H
//******************************************************************************
//*this code is protected by the GNU affero GPLv3
//*author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com>
//*                        <digital.ragnarok AT gmail dot com>
//******************************************************************************
struct cfg_ctx{
  i fd;
  void *m;
  u64 sz;
};
s8 cfg_file_open_ro(struct cfg_ctx *c);
s8 cfg_file_close(struct cfg_ctx *c);

s64 cfg_line_end_reach(struct cfg_ctx *c,s64 of);
s64 cfg_blanks_skip(struct cfg_ctx *c,s64 start,s64 line_end);
s64 cfg_non_blanks_skip(struct cfg_ctx *c,s64 start,s64 line_end);
#define CFG_KEY_SKIP_TO_VAL_NO_VAL -1
s64 cfg_key_skip_to_val(struct cfg_ctx *c,s64 start,s64 line_end);
#endif
